<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>扇贝 兰芷馥郁 活动助手</title>
    <style>
        .main {
            position: relative;
            width: 100%;
            height: 100%;
        }

        table,
        th,
        td {
            border: 1px solid black;
        }

        table {
            /* width: 70vw; */
            margin: 20px auto;
        }

        td:hover {
            background-color: rosybrown;
        }

        .rec {
            position: relative;
            width: 45vw;
            height: 25vw;
            max-width: 300px;
            max-height: 150px;
            min-width: 100px;
            min-height: 50px;
            display: block;
        }

        .rec h2 {
            text-align: center;
            font-size: 1em;
        }

        .rec h4 {
            position: absolute;
            bottom: 4px;
            left: 4px;
            color: steelblue;
            font-size: 0.5em;
        }

        a {
            text-decoration: none;
            color: slateblue;
        }

        .log {
            display: block;
            position:absolute;
            top: -20px;
            right: -10px;
            width: 50px;
            height: 50px;
            color: rgba(255, 255, 255, 0.5);
            background-color: rgba(0, 0, 0, 0.1);
            border-radius: 50px;
            line-height: 50px;
            text-align: center;
        }
    </style>
    <script language="javascript" type=text/javascript>
        function fetchHeader(url, wch) {
            try {
                var req=new XMLHttpRequest();
                req.open("HEAD", url, false);
                req.send(null);
                if(req.status== 200){
                    return req.getResponseHeader(wch);
                }
                else return false;
            } catch(er) {
                return er.message;
            }
        }

        files = ['zq.xlsx','早起团.html','沁心运动.xlsx','沁心运动.html','惜时社.xlsx','惜时社.html','短文翻译.xlsx', '短文翻译.html']
        // alert(fetchHeader('./早起团.html','Last-Modified'));
        // document.querySelectorAll('.rec .last-modify-time').forEach( (d,i) => {console.log(i);d.innerText=i;})
        let i = 0;
        doms = []
        const h = setInterval(() => {
            if (i >= files.length) {
                clearInterval(h)
                return;
            }

            if (doms.length === 0) {
                doms = document.querySelectorAll('.rec .last-modify-time');
            }

            t = fetchHeader('./' + files[i], 'Last-Modified')
            d = doms[i];

            if (d) d.innerText = (new Date(t)).toLocaleString();
            i++;
        }, 100);

        </script>
</head>

<body>
    <div class="main">
        <table>
            <tr>
                <td>
                    <a class="rec" href="./zq.xlsx">
                        <h2>早起统计表格</h2>
                        <h4>最近更新于：<span class="last-modify-time">*</span></h4>
                    </a>
                </td>
                <td>
                    <a class="rec" href="./早起团.html">
                        <h2>早起回帖检查</h2>
                        <h4>最近更新于：<span class="last-modify-time">*</span></h4>
                    </a>
                </td>
            </tr>
            <tr>
                <td>
                    <a class="rec" href="./沁心运动.xlsx">
                        <h2>运动统计表格</h2>
                        <h4>最近更新于：<span class="last-modify-time">*</span></h4>
                    </a>
                </td>
                <td>
                    <a class="rec" href="./沁心运动.html">
                        <h2>运动回帖检查</h2>
                        <h4>最近更新于：<span class="last-modify-time">*</span></h4>
                    </a>
                </td>
            </tr>
            <tr>
                <td>
                    <a class="rec" href="./惜时社.xlsx">
                        <h2>惜时统计表格</h2>
                        <h4>最近更新于：<span class="last-modify-time">*</span></h4>
                    </a>
                </td>
                <td>
                    <a class="rec" href="./惜时社.html">
                        <h2>惜时回帖检查</h2>
                        <h4>最近更新于：<span class="last-modify-time">*</span></h4>
                    </a>
                </td>
            </tr>
            <tr>
                <td>
                    <a class="rec" href="./短文翻译.xlsx">
                        <h2>翻译统计表格</h2>
                        <h4>最近更新于：<span class="last-modify-time">*</span></h4>
                    </a>
                </td>
                <td>
                    <a class="rec" href="./短文翻译.html">
                        <h2>翻译回帖检查</h2>
                        <h4>最近更新于：<span class="last-modify-time">*</span></h4>
                    </a>
                </td>
            </tr>
        </table>
        <a class="log" href="./log-auto.txt">Logs</a>
    </div>
</body>

</html>